package com.example.demo.exception;

/**
 * SDSP公共异常类
 * 
 * @author 16030136
 * 
 */
public class SPIPException extends Exception {
	private static final long serialVersionUID = 1L;
	private final String messageCode;

	public SPIPException() {
		super();
		this.messageCode = null;
	}

	public SPIPException(String message, Throwable cause,
			boolean enableSuppression, boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
		this.messageCode = null;
	}

	public SPIPException(String message, Throwable cause) {
		super(message, cause);
		this.messageCode = null;
	}

	public SPIPException(String message) {
		super(message);
		this.messageCode = null;
	}

	public SPIPException(CodeEnums codeEnums) {
		super(codeEnums.getMsg());
		this.messageCode = codeEnums.getCode();
	}

	public SPIPException(Throwable cause) {
		super(cause);
		this.messageCode = null;
	}

	public SPIPException(String messageCode,String message) {
		super(message);
		this.messageCode = messageCode;
	}

	public String getMessageCode() {
		return messageCode;
	}

	@Override
	public String toString() {
		return "SDSPBaseException [message=" + getMessage() + ", messageCode="
				+ messageCode + "]";
	}
}
